<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<form:form commandName="model" cssClass="validate"
	action="app/message/sender/save">
	<form:hidden path="id" />
	<form:hidden path="sourceId" />
	<table class=" form-table">
		<tbody>
			<c:choose>
				<c:when test="${empty cusUserId }">
					<tr>
						<td class="td1">接收人：</td>
						<td class="td2"><form:hidden path="receiverId"></form:hidden>
							<isperp:departmentUser name="receiverName"
								displayValue="${model.receiverName }"
								valueControlId="receiverId" multiselect="true"
								displayValueCssClass="input-textarea" id="receiverIdsSelect"></isperp:departmentUser>
						</td>
					</tr>
					<tr>
						<td class="td1">发送类型：</td>
						<td class="td2"><form:checkboxes items="${messageTypes }"
								path="messageType" /></td>
					</tr>


					<tr>
						<td class="td1">标题：</td>
						<td class="td2"><form:input path="title" cssStyle="width:85%" />
						</td>
					</tr>
				</c:when>
				<c:otherwise>
					<tr>
						<td class="td1">接收人：</td>
						<td class="td2"><form:hidden path="receiverId" /> <form:input
								readonly="true" path="receiverName" /></td>
					</tr>
					<tr>
						<td class="td1">发送类型：</td>
						<td class="td2"><form:hidden path="messageType" />站内信</td>
					</tr>
				</c:otherwise>
			</c:choose>

			<tr>
				<td class="td1">内容：</td>
				<td class="td2"><form:textarea path="content"
						cssStyle="width:85%;height:220px" cssClass="editor" /></td>
			</tr>

		</tbody>
	</table>

</form:form>
<isperp:buttonList>
	<button class="submit" onclick="isperp.submitForm();return false;">
		<span class="icon icon-save"></span>提交
	</button>
</isperp:buttonList>